<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<?php
//查询SQL，如果要显示自定义字段记得在SQL里增加查询字段
$query="{$configApp['sql']} $limit_str";
//echo $query;

$sql=$empire->query($query);

$url="<a href='../../'>首页</a>&nbsp;>&nbsp;<a href='../member/cp/'>控制面板</a>&nbsp;>&nbsp;<a href='ListInfo.php?mid=$mid'>管理信息</a>&nbsp;(".$mr[qmname].")";
require(ECMS_PATH.'e/data/template/cp_1.php');
?>
<input type='hidden' id='newsurl' value='<?=$public_r['newsurl']?>' />
<div class="dmain_conent">
	<div class="pageindex">
		<a href='<?=$public_r[newsurl]?>e/l/?mid=11' class="tips">我创建的部落</a>
		<a href='<?=$public_r[newsurl]?>e/l/?mid=11&m=j' class="tips ">我参加的部落</a>
		<a href='<?=$public_r[newsurl]?>e/l/?mid=11&m=fs' class="tips active">好友的部落</a>		
	</div>
	<div class='dmini-content'>		
<style>
.list_table{background:#fff;margin:0px 0px;width:100%}
.list_table thead tr{background:#eee;}
</style>
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="list_table">
	<thead>
		 <tr class="header"> 
			<th width="40%" height="25"> <div align="center">部落名称</div></th>
			<th width="8%" height="25"> <div align="center">创建人</div></td>
			<th width="13%" height="25"> <div align="center">地域</div></th>
			<th width="16%"><div align="center">创建时间</div></th>
			<th width="17%" height="25"><div align="center">操作</div></th>
		</tr>
	</thead>
	<tbody>
		  <?
			while($r=$empire->fetch($sql)){				//状态
			
				$is_list=true;
				$st='';
				if($r[istop])//置顶
				{
					$st.="<font color=red>[顶".$r[istop]."]</font>";
				}
				if($r[isgood])//推荐
				{
					$st.="<font color=red>[推]</font>";
				}
				if($r[firsttitle])//头条
				{
					$st.="<font color=red>[头]</font>";
				}
				$createUser=getUserInfo($r['userid']);
				//时间
				$newstime=date("Y-m-d",$r[newstime]);
				$oldtitle=$r[title];
				$r[title]=stripSlashes(sub($r[title],0,50,false));
				$r[title]=DoTitleFont($r[titlefont],$r[title]);
				if(empty($r[checked]))
				{$checked="<font color=red>×</font>";}
				else
				{$checked="√";}
				$plnum=$r[plnum];//评论个数
				//$titleurl=sys_ReturnBqTitleLink($r);//链接
				$titleurl=$public_r['newsurl'].'tribe/detail/?id='.$r[id];
				//标题图片
				$showtitlepic="";
				if($r[titlepic])
				{$showtitlepic="<a href='".$r[titlepic]."' title='预览标题图片' target=_blank><img src='../data/images/showimg.gif' border=0></a>";}
				//栏目
				$classname=$class_r[$r[classid]][classname];
				$classurl=sys_ReturnBqClassname($r,9);
				$bclassid=$class_r[$r[classid]][bclassid];
				$br['classid']=$bclassid;
				$bclassurl=sys_ReturnBqClassname($br,9);
				$bclassname=$class_r[$bclassid][classname];
				$is_joined=DbTouch('phome_jat_jointribe',array('uid'=>$user[userid],'tid'=>$r['id']));
				//var_dump($is_joined);
			?>
		  <tr bgcolor="#FFFFFF" id=news<?=$r[id]?>> 
			<td height="25"> <div align="left"> 
				<?=$st?><?=$r[titlepic]?"<img src='{$r[titlepic]}' height='20'/>":""?>
				<a href="<?=$titleurl?>" target=_blank title="<?=$oldtitle?>"> 
				<strong><?=$r[title]?></strong>
				</a>			  
			  </div></td>
			<td height="25"> <div align="center"> <a title="<?=$createUser['nickname']?>" href='<?=$public_r['newsurl']?>e/member/sp/?uid=<?=$r['userid']?>' target='_blank'> 
				<?=$createUser['nickname']?>
				</a> </div></td>
			<td height="25"> <div align="center"><?=$r['province']?>---<?=$r['city']?></div></td>
			<td>
				<?=date('Y-m-d H-i-s',$r['newstime'])?>
			</td>
			<td height="25">
				<div align="center">
				<?php if($is_joined){?>
					[<a href="<?=$public_r['newsurl']?>e/o/?tid=<?=$r[id]?>&enews=exitTribe" class='tribe_relte' is_jion='1' tid='<?=$r['id']?>'>退出</a>]
				<?php }else{?>
					[<a href="<?=$public_r['newsurl']?>e/o/?tid=<?=$r[id]?>&enews=exitTribe" class='tribe_relte' is_jion='0'  tid='<?=$r['id']?>'>加入</a>]
				<?php }?>
				</div>
			 </td>
		  </tr>
		  <?
			}
				if(!$is_list){echo '<tr><td colspan="6"><div class="no-data">暂无数据！</div></td></tr>';}
			?>
		
			  <tr><td colspan='6'><?=$returnpage?></td></tr>
		
</table>
	</div>
</div>
<?php
require(ECMS_PATH.'e/data/template/cp_2.php');
?>